1. Field of the Invention
The invention relates to a parallel counting technique for objects (connections) to be counted in parallel, such as a UPC or NPC function for monitoring the proper rate of flow of cells in a UNI or NNI in an ATM switching unit.
2. Description of the Related Art
An ATM (Asynchronous Transfer Mode) type of switching unit is equipped with a UPC (Usage Parameter Control) or NPC (Network Parameter Control) function for monitoring the proper rate of flow of cells in a UNI (User-to-Network Interface) or NNI (Network-to-Network Interface).
In the UPC or NPC function, a cell flow rate monitoring algorithm called a leaky bucket (LB) algorithm or virtual scheduling (VS) algorithm is used. A problem of cell flow interval is associated with these algorithms. Thus, a time counter is needed which is a clock for managing times at which cells are received. In this case, the time counter is implemented by hardware or software to have a predetermined bit length and so its count length is not unlimited.
The time counter has a limited count range as described above and provides the same count output at regular intervals. To calculate the difference (cell interval) between the time when the previous cell was received and the time when the present cell is received for each connection, it is required to store in memory an overflow flag for each connection, which indicates how many times the counter overflowed (regression from the maximum count to zero) during the cell interval. To calculate the cell interval, it is required to refer to the overflow flag stored in the memory as well as the counter value when the present cell is received and the stored counter value when the previous cell was received.
Conventionally, the same time counter is used for calculating the cell intervals for all the connections. In this case, a fixed amount of time is required from the time when the counter overflows to the time when overflow flags for all the connections stored in the memory have been updated. For example, when the count in the time counter periodically varies with time t as shown in FIG. 1, although the overflow flag for the connection c.sub.0 in the memory is updated at the overflow flag processing time t.sub.0, i.e., at about the same time an overflow occurs in the time counter, the overflow flag for an arbitrary connection c.sub.n will not be updated until a fixed time tn elapses after the occurrence of the overflow in the time counter. For this reason, if, after an overflow occurs in the time counter, a cell corresponding to a connection for which the corresponding overflow flag is not updated yet is received, the cell interval for that connection would be calculated on the basis of the wrong (unprocessed) overflow flag. The cell interval in this case becomes inaccurate (short). For example, in FIG. 1, when a cell corresponding to the connection c.sub.n is received between the overflow processing times t.sub.0 and t.sub.n, the cell interval calculated for that connection c.sub.n will be shorter by one overflow period.
The above problems will arise not only in the UPC or NPC function in an ATM switching unit, but also in processing of overflow in a counter for a plurality of objects to be counted in parallel.